<template>
  <view>
    <view class="padding-bottom-sm"></view>

    <view class="list bg-white">
      <my-tab-item
        v-for="i in mobile"
        :key="i.id"
        img="../../static/images/w1.png"
        title="手机话费"
        :info="i.type + i.card_no"
        :date="i.created_at"
        :change="i.amount"
      ></my-tab-item>
			
			<my-tab-item
			  v-for="i in oilcard"
			  :key="i.id"
			  img="../../static/images/w3.png"
			  :title="i.type"
			  :info="i.type + i.card_no"
			  :date="i.created_at"
			  :change="i.amount"
			></my-tab-item>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      mobile: [],
			oilcard: []
    };
  },
  onLoad(opt) {
    this.getLogs(opt.type);
  },
  methods: {
    getLogs(type) {
      this.$u.get("card/recharge/logs/" + type).then(res => {
        if (type == 'mobile') {
					this.mobile = res.data.result.logs;
				}
				if (type == 'oilcard') {
					this.oilcard = res.data.result.logs;
				}
      });
    }
  }
};
</script>

<style lang="scss">
page {
  background-color: #f5f5f5;
}
</style>
